//
//  EnvironmentDetailCell.m
//  OperationPro
//
//  Created by yaxue wang on 2017/1/6.
//  Copyright © 2017年 展鸿科技. All rights reserved.
//

#import "EnvironmentDetailCell.h"
#import "PollingTableModel.h"
@interface EnvironmentDetailCell()



@end
@implementation EnvironmentDetailCell

- (void)initView{
    [super initView];
    self.backgroundColor =[UIColor whiteColor];

    self.nameLab = [[UILabel alloc]init];
    [self addSubview:self.nameLab];
    CGFloat witdh =(WindowWidth-30)/2;
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self).offset(0);
        make.bottom.equalTo(self).offset(0);
        make.width.equalTo(@(witdh));

    }];
    self.nameLab.textColor =C(@"585858");
    self.nameLab.font =F(14);
    self.nameLab.numberOfLines=0;
   
    self.contexLab =[[UILabel alloc]init];
    [self addSubview:self.contexLab];
    [self.contexLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLab.mas_right).offset(5);
        make.right.equalTo(self).offset(-15);
        make.centerY.equalTo(self);
        
    }];
    self.contexLab.textColor =C(@"b9b8b8");
    self.contexLab.font =F(12);
    self.contexLab.numberOfLines=0;
    self.contexLab.textAlignment =NSTextAlignmentRight;
    self.line=[[UILabel alloc]init];
    [self addSubview:self.line];
    [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self);
        make.right.equalTo(self);
        make.bottom.equalTo(self);
        make.height.equalTo(@(.5));
    }];
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
}
//- (void)setModel:(id)model{
//    
//    PollingTableModel *order = model;
//    self.line.backgroundColor=LineColor;
//    
//    self.nameLab.text =order.P_name;
//    NSString *state;
//    if ([order.P_result isEqualToString:@""]||order.P_result ==nil) {
//        state=@"";
//    }else
//    {
//        // result字段： 1 - 正常; 2 - 异常
//        if ([order.P_result isEqualToString:@"1"]) {
//            state=order.P_good_text;
//            self.contexLab.textColor =C(@"b9b8b8");
//
//
//        }else
//        {
//            state=order.P_bad_text;
//            self.contexLab.textColor =MainColor;
//
// 
//        }
//        
//    }
//    NSString *remark;
//    if (order.P_remark ==nil||[order.P_remark isEqualToString:@""])
//    {
//        remark=@"";
//    }else
//    {
//        remark=[NSString stringWithFormat:@"；%@", order.P_remark];
//
//    }
//    self.contexLab.text =[NSString stringWithFormat:@"%@ %@",state,remark];
//
//}
@end
